home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 6
/
Amiga Format AFCD06 (Nov 1996, Issue 90).iso
/
serious
/
commercial
/
cloanto
/
ppaint
/
rexx
/
framestoanim.pprx
< prev
next >
Wrap
Text File
|
1995-09-16
|
2KB
|
100 lines
/* PPaint Amiga Rexx script - Copyright © 1995 Cloanto Italia srl */
/*
$VER: FramesToAnim.pprx 1.1
*/
MYPORT = 'PPAINT'
IF ~SHOW('P', MYPORT) THEN DO
IF EXISTS('PPaint:PPaint') THEN DO
ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
DO 30 WHILE ~SHOW('P',MYPORT)
ADDRESS COMMAND 'Wait >NIL: 1 SEC'
END
END
ELSE DO
SAY "Personal Paint could not be loaded."
EXIT 10
END
END
IF ~SHOW('P', MYPORT) THEN DO
SAY 'Personal Paint Rexx port could not be opened.'
EXIT 10
END
ADDRESS VALUE MYPORT
OPTIONS RESULTS
OPTIONS FAILAT 10000
Version 'REXX'
rexxversion = RESULT
IF rexxversion < 3 THEN DO
errmess = 'This script requires a newer_version of Personal Paint.'
SAY errmess
RequestNotify 'PROMPT="'errmess'"'
EXIT 10
END
IF rexxversion < 4 THEN DO
FreeBrush
IF RC ~= 0 THEN EXIT
bshfname = 'T:pprx_bsh.'PRAGMA('ID')
IF OPEN(bshfile, bshfname, 'W') THEN DO
WRITECH(bshfile, '464F524D 0000002A 494C424D 424D4844 00000014 00010001 00000000 01020100 00001010 028001E0 424F4459 00000002 FF00'X)
CALL CLOSE(bshfile)
LoadBrush bshfname FORCE
END
END
LockGUI
RequestFile '"Select First Frame of Sequence"'
IF RC = 0 THEN DO
loadname = RESULT
pos = LASTPOS('.', loadname)
len = LENGTH(loadname)
errcode = 0
IF pos = 0 THEN DO
errmess = 'Invalid frame name'
errcode = 1000
END
ELSE DO
name = SUBSTR(loadname, 2, pos - 2)
digits = len - pos - 1
fnum = SUBSTR(loadname, pos + 1, digits)
END
IF errcode = 0 THEN DO
DO FOREVER
AddFrames /* add one frame */
SetFramePos NEXT
fname = name || "." || RIGHT(fnum, digits, "0");
LoadImage '"'fname'"' FORCE QUIET
IF RC ~= 0 THEN DO
IF RC = 5 THEN
errmess = 'User abort during load.'
ELSE IF RC ~= 36 THEN
errmess = 'Error 'RC' during load.'
IF RC ~= 36 THEN errcode = RC
DelFrames /* delete current (unused) frame */
OptimizeAnim QUIET
LEAVE
END
fnum = fnum + 1
END
END
IF errcode > 0 THEN DO
SAY errmess
RequestNotify 'PROMPT="'errmess'"'
END
END
UnlockGUI
IF rexxversion < 4 THEN DO
FreeBrush FORCE
ADDRESS COMMAND 'Delete >NIL: 'bshfname
END